Display method and apparatus

ABSTRACT

A display method and an apparatus that relates to the field of communications technologies, to avoid a problem that a process of a currently running application cannot continue due to disconnection of a terminal when the terminal performs multi-screen display. The method includes a first terminal sending first display data to a second terminal after the first terminal connects to the second terminal, so that the second terminal displays a first interface. In this case, the first terminal displays a second interface (the second interface is different from the first interface). The first terminal disconnects from the second terminal; and after the first terminal reconnects to the second terminal, the first terminal may send second display data to the second terminal, so that the second terminal displays a third interface correlated with the first interface.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/619,857, filed on Dec. 5, 2019, which is a national stage ofInternational Application No. PCT/CN2017/087818, filed on Jun. 9, 2017.All of the aforementioned applications are hereby incorporated byreference in their entireties.

TECHNICAL FIELD

Embodiments of this application relate to the field of communicationstechnologies, and in particular, to a display method and an apparatus.

BACKGROUND

Using a mobile terminal as a personal computer (PC) is one significantway to implement mobile officing. Specifically, the mobile terminal suchas a mobile phone can project display content on a screen of the mobilephone onto a large-screen display such as a large-screen display of a PCby using a wireless video display (Wi-Fi Display) function or aMicrosoft™ continuum (continuum) function, so that the mobile phone canalso be used as the PC after the mobile phone connects to thelarge-screen display.

After the mobile phone connects to the large-screen display, the mobilephone has two displays: one is a display of the mobile phone, and theother is the large-screen display of a large screen terminal connectedto the mobile phone. The mobile phone may control the two displays tosimultaneously display a same display interface, or may control the twodisplays to respectively run two independent display interfaces.

When the mobile phone disconnects from the large-screen display, awindow of an application running on the large-screen display is forciblyclosed. In addition, when the mobile phone reconnects to thelarge-screen display, a display interface on the large-screen displayneeds to be re-initialized, to show a desktop display interface on thelarge-screen display to a user.

SUMMARY

Embodiments of this application provide a display method and anapparatus, to avoid a technical problem that a process of a currentlyrunning application cannot continue upon reconnection due todisconnection of a terminal when the terminal performs multi-screendisplay.

To achieve the foregoing objectives, the embodiments of this applicationuse the following technical solutions:

According to a first aspect, an embodiment of this application providesa display method, including the following: A first terminal sends firstdisplay data to a second terminal after the first terminal connects tothe second terminal, so that the second terminal displays a firstinterface. In this case, the first terminal displays a second interface(the second interface is different from the first interface). The firstterminal disconnects from the second terminal; and after the firstterminal reconnects to the second terminal, the first terminal may sendsecond display data to the second terminal, so that the second terminaldisplays a third interface correlated with the first interface. Forexample, an element in the third interface may be the same as an elementin the first interface, so that a related interface that is displayed onthe second terminal upon the previous disconnection is resumed in adisplay interface of the second terminal. In this way, an applicationseamlessly continues before and after the first terminal disconnectsfrom the second terminal, thereby improving user experience inmulti-screen display performed by a terminal.

In a possible design method, that the third interface is correlated withthe first interface includes: an application displayed in the thirdinterface is the same as an application displayed in the firstinterface; or an interface displayed in the third interface is the sameas an interface displayed in the first interface; or an interfacedisplayed in the third interface and an interface displayed in the firstinterface are adjacent interfaces of one application.

In a possible design method, when the application displayed in the thirdinterface is the same as the application displayed in the firstinterface, the same application may be any one of a video application, atext application, an instant messaging application, or a gameapplication.

In a possible design method, that an interface displayed in the thirdinterface is the same as an interface displayed in the first interfacemay specifically include: video playback progress displayed in the thirdinterface is the same as video playback progress displayed in the firstinterface, so that a video seamlessly continues before and after thefirst terminal disconnects from the second terminal; or document contentdisplayed in the third interface is the same as document contentdisplayed in the first interface, so that a document seamlesslycontinues before and after the first terminal disconnects from thesecond terminal; or a chat record in a chat window in the thirdinterface is the same as a chat record in a chat window in the firstinterface, so that a communication process seamlessly continues beforeand after the first terminal disconnects from the second terminal; or agame system interface displayed in the third interface is the same as agame system interface displayed in the first interface, so that a gameapplication seamlessly continues before and after the first terminaldisconnects from the second terminal.

In a possible design method, the chat record includes an unsent chatdraft in an input box. In this way, after the first terminal reconnectsto the second terminal, a user does not need to re-enter the chat draftinto the input box.

In a possible design method, when the interface displayed in the thirdinterface and the interface displayed in the first interface areadjacent interfaces of one application, the method further includes:sending, by the first terminal, third display data to the secondterminal in response to an operation triggered by a user, so that thesecond terminal switches from the third interface to the firstinterface. In this way, after the first terminal reconnects to thesecond terminal, the user needs to perform only one operation, to resumea related display interface that is originally displayed on the secondterminal.

In a possible design method, a display location of a target applicationin the third interface is the same as a display location of the targetapplication in the first interface, and the target application is arunning application displayed in both the first interface and the thirdinterface. In this way, a window of the target application is displayedat a same location on the second terminal before and after thedisconnection, thereby further improving user experience in multi-screendisplay performed by a terminal.

In a possible design method, an application displayed in the thirdinterface is the same as at least one of applications displayed in thefirst interface; or an application displayed in the third interface is asubset of applications displayed in the first interface; or applicationsdisplayed in the third interface are all the same as applicationsdisplayed in the first interface, and locations of the applicationsdisplayed in the third interface are the same as locations of theapplications displayed in the first interface.

In a possible design method, after the first terminal disconnects fromthe second terminal, the method further includes: stopping, by the firstterminal, sending the first display data to the second terminal; anddisplaying, by the first terminal, a fourth interface correlated withthe third interface. To be specific, when the first terminal disconnectsfrom the second terminal, the first terminal may switch from a relatedinterface that is displayed on the second terminal at this time to adisplay interface of the first terminal, so that a user can stillcontinue to perform a related function of the target application on thefirst terminal during the disconnection, thereby reducing impact, on anexecution process of the target application, that is caused because thefirst terminal disconnects from the second terminal is reduced.

For example, an interface element in the fourth interface is the same asan interface element in the third interface.

In a possible design method, when the first terminal disconnects fromthe second terminal, the method further includes: recording, by thefirst terminal in a read-only memory (ROM), historical display data thatis on the second terminal upon the disconnection, where the historicaldisplay data is used to indicate display content that is on the secondterminal upon the disconnection. In this way, running status informationrecorded in the ROM is not lost even after the first terminal is poweredoff and powered on again. Therefore, after the first terminal reconnectsto the second terminal, the first terminal may also resume, in thedisplay interface of the second terminal based on the historical displaydata, the display content that is on the second terminal upon thedisconnection.

According to a second aspect, an embodiment of this application providesa terminal, including a processor, a memory, a bus, and a communicationsinterface The communications interface is configured to send firstdisplay data to another terminal after the terminal connects to theanother terminal, so that the another terminal displays a firstinterface, where the terminal displays a second interface, and the firstinterface is different from the second interface; the processor isconfigured to instruct the terminal to disconnect from the anotherterminal; and the communications interface is further configured to sendsecond display data to the another terminal after the terminalreconnects to the another terminal, so that the another terminaldisplays a third interface, where the third interface is correlated withthe first interface.

In a possible design method, that the third interface is correlated withthe first interface includes: an application displayed in the thirdinterface is the same as an application displayed in the firstinterface; or an interface displayed in the third interface is the sameas an interface displayed in the first interface; or an interfacedisplayed in the third interface and an interface displayed in the firstinterface are adjacent interfaces of one application.

In a possible design method, when the application displayed in the thirdinterface is the same as the application displayed in the firstinterface, and the same application is any one of a video application, atext application, an instant messaging application, or a gameapplication.

In a possible design method, that an interface displayed in the thirdinterface is the same as an interface displayed in the first interfaceincludes: video playback progress displayed in the third interface isthe same as video playback progress displayed in the first interface; ordocument content displayed in the third interface is the same asdocument content displayed in the first interface; or a chat record in achat window in the third interface is the same as a chat record in achat window in the first interface; or a game system interface displayedin the third interface is the same as a game system interface displayedin the first interface.

In a possible design method, the chat record includes an unsent chatdraft in an input box.

In a possible design method, when the interface displayed in the thirdinterface and the interface displayed in the first interface areadjacent interfaces of one application, the communications interface isfurther configured to send third display data to the another terminal,so that the another terminal switches from the third interface to thefirst interface.

In a possible design method, a display location of a target applicationin the third interface is the same as a display location of the targetapplication in the first interface, and the target application is arunning application displayed in both the first interface and the thirdinterface.

In a possible design method, an application displayed in the thirdinterface is the same as at least one of applications displayed in thefirst interface; or an application displayed in the third interface is asubset of applications displayed in the first interface; or applicationsdisplayed in the third interface are all the same as applicationsdisplayed in the first interface, and locations of the applicationsdisplayed in the third interface are the same as locations of theapplications displayed in the first interface.

In a possible design method, the terminal further includes a display.The processor is further configured to stop sending the first displaydata to the another terminal by using the communications interface; andthe display is configured to display a fourth interface correlated withthe third interface.

In a possible design method, an interface element in the fourthinterface is the same as an interface element in the third interface.

In a possible design method, the processor is further configured torecord, in the memory, historical display data that is on the anotherterminal upon the disconnection, where the historical display data isused to indicate display content that is on the another terminal uponthe disconnection.

According to a third aspect, an embodiment of this application providesa terminal, including: a communications unit, configured to connect toanother terminal, so that the terminal and the another terminal cancommunicate with each other; a control unit, configured to: when theterminal disconnects from the another terminal, stop inputting firstdisplay data to the another terminal, so that a target applicationrunning in a display interface of the another terminal is closed; and arecord unit, configured to record historical display data that is on theanother terminal when the terminal disconnects from the anotherterminal, where the historical display data is used to indicate displaycontent that is on the another terminal at this time. The communicationsunit is further configured to: when the terminal reconnects to theanother terminal, obtain the historical display data and send seconddisplay data to the another terminal based on the historical displaydata, so that a window of the target application is resumed in thedisplay interface of the another terminal.

According to a fourth aspect, an embodiment of this application providesa terminal, including a processor, a memory, a bus, and a communicationsinterface. The memory is configured to store a computer executioninstruction. The processor is connected to the memory by using the bus,and when the terminal runs, the processor executes the computerexecution instruction stored in the memory, so that the terminalperforms any one of the foregoing display methods.

According to a fifth aspect, an embodiment of this application providesa computer readable storage medium. The computer readable storage mediumstores an instruction, and when the instruction runs on any one of theforegoing terminals, the terminal performs any one of the foregoingdisplay methods.

According to a sixth aspect, an embodiment of this application providesa computer program product including an instruction. When the computerprogram product runs on any one of the foregoing terminals, the terminalperforms any one of the foregoing display methods.

In the embodiments of this application, names of the foregoing terminalsconstitute no limitation on the devices. In actual implementation, thesedevices may appear in other names. The devices fall within the scope ofthe claims of this application and their equivalent technologies,provided that functions of the devices are similar to those in theembodiments of this application.

In addition, for technical effects brought by any one of the designmanners in the second aspect to the sixth aspect, refer to technicaleffects brought by different design methods in the first aspect. Detailsare not described herein again.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1A and FIG. 1B are schematic diagrams of an application scenario ofa display method according to an embodiment of this application;

FIG. 2A and FIG. 2B are schematic diagrams of a homogenous displayprinciple according to an embodiment of this application;

FIG. 3A and FIG. 3B are schematic diagrams of a heterogenous displayprinciple according to an embodiment of this application;

FIG. 4A, FIG. 4B, and FIG. 4C are schematic diagram of applicationscenarios before and after a first terminal disconnects from a secondterminal in the prior art;

FIG. 5 is a schematic structural diagram of a mobile phone according toan embodiment of this application;

FIG. 6 is a schematic flowchart of a display method according to anembodiment of this application;

FIG. 7A and FIG. 7B are schematic diagrams 1 of an application scenarioof a display method according to an embodiment of this application;

FIG. 8 is a schematic diagram 2 of an application scenario of a displaymethod according to an embodiment of this application;

FIG. 9 is a schematic diagram 3 of an application scenario of a displaymethod according to an embodiment of this application;

FIG. 10 is a schematic diagram 4 of an application scenario of a displaymethod according to an embodiment of this application;

FIG. 11 is a schematic diagram 5 of an application scenario of a displaymethod according to an embodiment of this application;

FIG. 12 is a schematic diagram 6 of an application scenario of a displaymethod according to an embodiment of this application;

FIG. 13 is a schematic diagram 7 of an application scenario of a displaymethod according to an embodiment of this application;

FIG. 14 is a schematic diagram 8 of an application scenario of a displaymethod according to an embodiment of this application;

FIG. 15 is a schematic diagram 9 of an application scenario of a displaymethod according to an embodiment of this application;

FIG. 16 is a schematic diagram 10 of an application scenario of adisplay method according to an embodiment of this application;

FIG. 17A and FIG. 17B are schematic diagrams 11 of an applicationscenario of a display method according to an embodiment of thisapplication;

FIGS. 18A, 18B and 18C are schematic diagrams 12 of an applicationscenario of a display method according to an embodiment of thisapplication;

FIG. 19 is a schematic diagram 13 of an application scenario of adisplay method according to an embodiment of this application;

FIG. 20 is a schematic diagram 14 of an application scenario of adisplay method according to an embodiment of this application;

FIG. 21 is a schematic structural diagram 1 of a terminal according toan embodiment of this application; and

FIG. 22 is a schematic structural diagram 2 of a terminal according toan embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The terms “first” and “second” in the following are merely intended fora purpose of description, and shall not be understood as an indicationor implication of relative importance or implicit indication of aquantity of indicated technical features. Therefore, a featurerestricted by “first” or “second” may explicitly indicate or implicitlyinclude one or more such features. In the descriptions in theembodiments of this application, unless otherwise provided, “a pluralityof” means two or more than two.

The embodiments of this application provide a display method. The methodmay be applied to mobile officing and another application scenario inwhich display data on a terminal needs to be displayed on a plurality ofdisplay screens. For example, as shown in FIG. 1A and FIG. 1B, a firstterminal 100 may be a mobile phone, a second terminal 200 may be adesktop computer or a standalone display. As shown in in FIG. 1A, thefirst terminal 100 may connect to the second terminal 200 in a wirelesscommunication mode (for example, Wi-Fi); or as shown in FIG. 1B, thefirst terminal 100 may connect to the second terminal 200 in a wiredcommunication mode (for example, a data cable). This is not limited inthis embodiment of this application.

The first terminal 100 may serve as a controlling device, and the secondterminal 200 may serve as a controlled device of the first terminal 100.After the first terminal 100 connects to the second terminal 200, itmeans that the first terminal 100 has two displays: one is a display ofthe first terminal 100, and the other is a display of the secondterminal 200 connected to the first terminal 100.

In this embodiment of this application, after the first terminal 100connects to the second terminal 200, the first terminal 100 may project,by using a homogenous display method or a heterogenous display method,an application installed on the first terminal 100 onto the display ofthe second terminal 200.

Homogenous display means that signal sources of display interfaces ondifferent displays, such as the display of the first terminal 100 andthe display of the second terminal 200, are the same. Heterogenousdisplay means that a signal source of a display interface on the displayof the first terminal 100 is independent of a signal source of a displayinterface on the display of the second terminal 200.

When the first terminal 100 homogeneously projects the applicationinstalled on the first terminal 100 onto the display of the secondterminal 200, as shown in FIG. 2A and FIG. 2B, before the first terminal100 connects to the second terminal 200, the first terminal 100 stores,in an application container of the application, an application taskgenerated by the application. In this way, the first terminal 100 canpresent, in the display interface of the first terminal 100, relatedimage display of the application simply by executing the applicationtask in the application container. After the first terminal 100 connectsto the second terminal 200, still as shown in FIG. 3A and FIG. 3B, thesecond terminal 200 may share the application container with the firstterminal 100. In this case, display content in the display interface ofthe second terminal 200 is displayed the same as display content in thedisplay interface of the first terminal 100, and synchronous display ofthe first terminal 100 and the second terminal 200 is implemented.

When the first terminal 100 heterogeneously projects the applicationinstalled on the first terminal 100 onto the display of the secondterminal 200, as shown in FIG. 2A and FIG. 2B, before the first terminal100 connects to the second terminal 200, the first terminal 100 stores,in an application container 1 (for example, an application stackcorresponding to an interface of the first terminal 100), an applicationtask that is generated by the application and that is being executed. Inthis way, the first terminal 100 displays a corresponding displayinterface on the display of the first terminal 100 when executing theapplication task in the application container 1.

After the first terminal 100 connects to the second terminal 200, thefirst terminal 100 may identify related specification information of thedisplay of the second terminal 200 connected to the first terminal 100,for example, a resolution and dots per inch (Dots Per Inch, DPI) of thedisplay of the second terminal 200. In this case, as shown in FIG. 2Aand FIG. 2B, the first terminal 100 may set up, in a memory based on thespecification information of the display of the second terminal 200, anapplication container 2 (for example, an application stack correspondingto an interface of the second terminal 200) for an application runningon the display of the second terminal 200. The application container 1and the application container 2 may be distinguished by using differentdisplay identifiers (Display ID).

After connecting to the second terminal 200, as shown in FIG. 2A andFIG. 2B, the first terminal 100 may initialize the display of the secondterminal 200, to convert information such as an application icon on thefirst terminal 100 into a desktop application task, such as anapplication icon, an icon layout, and a status bar, that matches thespecification information of the second terminal 200, and store thedesktop application task in the application container 2. In this way,the second terminal 200 can independently project information such asicons of all applications installed on the first terminal 100 onto thedisplay interface of the second terminal 200 simply by executing thedesktop application task in the application container 2, to complete aprocess of initializing the display of the second terminal 200.Subsequently, the first terminal 100 and the second terminal 200 mayindependently run the two display interfaces in a same operating systemby executing the application tasks in the respective applicationcontainers of the terminals.

The application container is storage space that is obtained by speciallypartitioning a memory when a terminal runs an application and that isused to store an application task generated by the application duringrunning. For example, the application container may be specifically anapplication stack, and an application task at the top of the stack iscontent that is currently run and displayed on the terminal. Forexample, an application A generates a plurality of application tasks(task) in an application stack of the application A during running, andthe terminal executes each task starting from the top of the stack anddisplays an execution result in a display interface of the terminal.

Currently, after the first terminal 100 connects to the second terminal200, the first terminal 100 and the second terminal 200 may run twoindependent display interfaces in a same operating system. As shown FIG.4B, the first terminal 100 and the second terminal 200 are in aconnected mode, the display interface of the first terminal 100 is adesktop interface, and a player application is running in the displayinterface on the second terminal 200. When the first terminal 100disconnects from the second terminal 200, the first terminal 100 deletesthe application container 2 indicated by a display ID 2, to release amemory resource occupied by the application container 2. In this case,as shown in FIG. 4B, the display interface of the second terminal 200 isswitched to a locked state or a native state of the second terminal 200.After the first terminal 100 reconnects to the second terminal 200, asshown in FIG. 4C, because the application container 2 corresponding tothe display interface of the second terminal 200 has been deleted, thefirst terminal 100 re-initializes the display interface of the secondterminal 200, and projects a desktop icon of an application or the likeinstalled on the first terminal 100 onto the display interface of thesecond terminal 200.

In this case, if a user needs to continue running the playerapplication, the user needs to restart the player application in thedisplay interface of the second terminal 200. Alternatively, if a userneeds to continue watching a movie played by the player application, forexample, at the twenty-eighth minute, the user needs to restart theplayer application on the second terminal 200 and adjust a play time ofthe movie. In other words, the player application can continue beforeand after the disconnection, and a window of the player application thatis being executed upon the previous disconnection cannot be resumed onthe second terminal 200 for the user.

To resolve this, in this embodiment of this application, when the firstterminal 100 disconnects from the second terminal 200, the firstterminal 100 may record display content that is on the second terminal200 and that is indicated by the application container 2 at this time.In this way, when the first terminal 100 reconnects to the secondterminal 200, the first terminal 100 may resume the applicationcontainer 2 based on the recorded display content on the second terminal200, so as to resume, in the display interface of the second terminal200, a related interface of a target application or the like that isbeing executed by the second terminal 200 upon the previousdisconnection. In this way, the target application seamlessly continuesbefore and after the first terminal 100 disconnects from the secondterminal 200 is implemented, thereby improving user experience inmulti-screen display performed by a terminal.

In addition, when executing a corresponding task in the applicationcontainer 2 and displaying an execution result on the display of thesecond terminal 200, the first terminal 100 may adjust a correspondingdisplay layout on the second display interface based on parameters suchas a screen resolution of the second terminal 200 and an operation habitof using the second terminal 200 by a user, for example, may adjust asize and a location of an application window, an application icon, andthe like. This is not limited in this embodiment of this application.

The display method provided in the embodiments of this application maybe applied to any terminal such as a mobile phone, a wearable device, anAR (augmented reality)\VR (virtual reality) device, a tablet computer, anotebook computer, an UMPC (ultra-mobile personal computer), a netbook,and a PDA (personal digital assistant). This is not limited in thisembodiment of this application.

As shown in FIG. 5, the first terminal (or the second terminal) in thisembodiment of this application may be a mobile phone 300. Thisembodiment is described below in detail by using the mobile phone 300 asan example. It should be understood that the mobile phone 300 shown inthe figure is merely an example of the terminal, and the mobile phone300 may include more or fewer components than those shown in the figure,may combine two or more components, or may have different componentconfigurations.

As shown in FIG. 5, the mobile phone 300 may specifically includecomponents such as a processor 101, a radio frequency (RF) circuit 102,a memory 103, a touchscreen 104, a Bluetooth apparatus 105, one or moresensors 106, a Wi-Fi apparatus 107, a positioning apparatus 108, anaudio circuit 109, a peripheral interface 110, and a power supply system111. These components may communicate with each other by using one ormore communications buses or signal cables (not shown in FIG. 5). Aperson skilled in the art may understand that a hardware structure shownin FIG. 5 constitute no limitation on the mobile phone. The mobile phone300 may include more or fewer components than those shown in the figure,or combine some components, or have different component arrangements.

The components of the mobile phone 300 are described below in detailwith reference to FIG. 5.

The processor 101 is a control center of the mobile phone 300. Theprocessor 101 is connected to all parts of the mobile phone 300 by usingvarious interfaces and lines, and performs various functions of themobile phone 300 and data processing by running or executing anapplication program (which may be briefly referred to as an App below)stored in the memory 103, and by invoking the data stored in the memory103. In some embodiments, the processor 101 may include one or moreprocessing units. For example, the processor 101 may be a Kirin 960™chip manufactured by Huawei Technologies Co., Ltd.

The radio frequency circuit 102 may be configured to receive and send aradio signal during information receiving and sending or during a call.In particular, the radio frequency circuit 102 may receive downlink datafrom a base station and then send the downlink data to the processor 101for processing, and send uplink data to the base station. A radiofrequency circuit usually includes but is not limited to an antenna, atleast one amplifier, a transceiver, a coupler, a low noise amplifier, aduplexer, and the like. In addition, the radio frequency circuit 102 mayfurther communicate with another device through wireless communication.The wireless communication may use any communication standard orprotocol, including but not limited to a Global System for MobileCommunications, a general packet radio service, Code Division MultipleAccess, Wideband Code Division Multiple Access, Long Term Evolution, anemail, a short messaging service, and the like.

The memory 103 is configured to store an application program and data.The processor 101 runs the application program and the data stored inthe memory 103, to perform various functions of the mobile phone 300 andprocess the data. The memory 103 mainly includes a program storage areaand a data storage area. The program storage area may store an operatingsystem and an application program (such as a sound playing function oran image playing function) that is required by at least one function.The data storage area may store data (such as audio data or a phonebook)that is created based on use of the mobile phone 300. In addition, thememory 103 may further include a high-speed random access memory, andmay include a nonvolatile memory, for example, a magnetic disk storagedevice, a flash storage device, or another volatile solid-state storagedevice. The memory 103 may store various operating systems, for example,an iOS operating system developed by Apple Inc. or an Android operatingsystem developed by Google Inc.

The touchscreen 104 may include a touchpad 104-1 and a display 104-2.The touchpad 104-1 may collect a touch event (for example, an operationperformed by a user on the touchpad 104-1 or near the touchpad 104-1 byusing any appropriate object such as a finger or a stylus) performed bya user of the mobile phone 300 on or near the touchpad 104-1, and sendcollected touch information to another device such as the processor 101.Although the touchpad 104-1 and the display screen 104-2 serve as twoindependent components in FIG. 5 to implement input and output functionsof the mobile phone 300, in some embodiments, the touchpad 104-1 and thedisplay screen 104-2 may be integrated to implement the input and outputfunctions of the mobile phone 300. It may be understood that thetouchscreen 104 is made of a plurality of layers of materials that arestacked together. In this embodiment of this application, only thetouchpad (layer) and the display screen (layer) are displayed, and otherlayers are not recorded in this embodiment of this application. Inaddition, in some other embodiments of this application, the touchpad104-1 may cover the display screen 104-2, and a size of the touchpad104-1 is greater than a size of the display screen 104-2, so that thedisplay screen 104-2 is fully covered by the touchpad 104-1.Alternatively, the touchpad 104-1 may be configured in a form of a fullpanel on a front surface of the mobile phone 300. In other words, alltouches of a user on the front surface of the mobile phone 300 can besensed by the mobile phone. In this way, full-touch experience can beimplemented on the front surface of the mobile phone. In some otherembodiments, the touchpad 104-1 is configured in a form of a full panelon a front surface of the mobile phone 300, and the display screen 104-2is also configured in a form of a full panel on the front surface of themobile phone 300. In this way, a bezel-less structure can be implementedon the front surface of the mobile phone.

In this embodiment of this application, the mobile phone 300 may furtherhave a fingerprint recognition function. For example, a fingerprintsensor 112 may be configured on a rear surface (for example, below arear-facing camera) of the mobile phone 300, or a fingerprint sensor 112may be configured on the front surface (for example, below thetouchscreen 104) of the mobile phone 300. For another example, afingerprint collection component 112 may be configured inside thetouchscreen 104 to implement the fingerprint recognition function. Inother words, the fingerprint collection component 112 may be integratedwith the touchscreen 104 to implement the fingerprint recognitionfunction of the mobile phone 300. In this case, the fingerprintcollection component 112 may be configured inside the touchscreen 104 asa part of the touchscreen 104 or may be configured inside thetouchscreen 104 in another manner. A fingerprint sensor is a maincomponent of the fingerprint collection component 112 in this embodimentof this application. The fingerprint sensor may use any type of sensingtechnology, including but not limited to an optical sensing technology,a capacitive sensing technology, a piezoelectric sensing technology, anultrasonic sensing technology, and the like.

In this embodiment of this application, the mobile phone 300 may furtherinclude the Bluetooth apparatus 105, configured to implement dataexchange between the mobile phone 300 and another terminal (for example,a mobile phone or a smartwatch) at a short distance from the mobilephone 300. The Bluetooth apparatus in this embodiment of thisapplication may be an integrated circuit, a Bluetooth chip, or the like.

The Wi-Fi apparatus 107 is configured to provide the mobile phone 300with network access that complies with a Wi-Fi related standardprotocol. The mobile phone 300 may gain access to a Wi-Fi access pointby using the Wi-Fi apparatus 107, to help a user receive and send anemail, browse a web page, visit streaming media, and so on. The Wi-Fiapparatus 107 provides the user with wireless broadband Internet access.In some other embodiments, the Wi-Fi apparatus 107 may serve as a Wi-Firadio access point and may provide another terminal with Wi-Fi networkaccess.

The mobile phone 300 may further include at least one type of sensor106, for example, an optical sensor, a motion sensor, or another sensor.Specifically, the optical sensor may include an ambient light sensor anda proximity sensor. The ambient light sensor may adjust luminance of thedisplay of the touchscreen 104 based on brightness of ambient light, andthe proximity sensor may turn off the display when the mobile phone 300moves to an ear. As a type of motion sensor, an accelerometer sensor maydetect an acceleration value in each direction (usually three axes), maydetect a value and a direction of gravity when the accelerometer sensoris static, and may be applied to an application for recognizing a mobilephone gesture (such as switching between a landscape mode and a portraitmode, a related game, or magnetometer posture calibration), a functionrelated to vibration recognition (such as a pedometer or a knock), andthe like. For other sensors such as a gyroscope, a barometer, ahygrometer, a thermometer, and an infrared sensor that may be furtherconfigured on the mobile phone 300, details are not described herein.

The positioning apparatus 108 is configured to provide the mobile phone300 with a geographical location. It may be understood that thepositioning apparatus 108 may be specifically a receiver in apositioning system such as a Global Positioning System (GPS), the BeiDouNavigation Satellite System™, or the Russian GLONASS™. After receiving ageographical location sent by the foregoing positioning system, thepositioning apparatus 108 sends the information to the processor 101 forprocessing, or sends the information to the memory 103 for storage. Insome other embodiments, the positioning apparatus 108 may be a receiverin an Assisted Global Positioning System (AGPS). The AGPS system servesas an assisted server to assist the positioning apparatus 108 incompleting ranging and positioning services. In this case, the assistedpositioning server provides positioning assistance by communicating withthe positioning apparatus 108 (namely, a GPS receiver) in a terminalsuch as the mobile phone 300 by using a wireless communications network.In some other embodiments, the positioning apparatus 108 may be apositioning technology based on a Wi-Fi access point. Because each Wi-Fiaccess point has one globally unique MAC address, when Wi-Fi is enabled,the terminal can scan and collect a broadcast signal of a surroundingWi-Fi access point. Therefore, the terminal can obtain a MAC addressbroadcast by the Wi-Fi access point. The terminal sends, to a locationserver by using a wireless communications network, the data (forexample, the MAC address) that can identify the Wi-Fi access point. Thelocation server retrieves a geographical location of each Wi-Fi accesspoint, calculates a geographical location of the terminal with referenceto strength of the Wi-Fi broadcast signal, and sends the geographicallocation of the terminal to the positioning apparatus 108 in theterminal.

The audio circuit 109, a loudspeaker 113, and a microphone 114 canprovide an audio interface between a user and the mobile phone 300. Theaudio circuit 109 may transmit, to the loudspeaker 113, an electricalsignal converted from received audio data, and the loudspeaker 113converts the electrical signal into a sound signal for output. Inaddition, the microphone 114 converts the collected sound signal into anelectrical signal. The audio circuit 109 receives the electrical signal,and then converts the electrical signal into audio data and outputs theaudio data to the RF circuit 102, to send the audio data to, forexample, another mobile phone, or output the audio data to the memory103 for further processing.

The peripheral interface 110 is configured to provide various interfacesfor an external input/output device (for example, a keyboard, a mouse,an external display, an external memory, and a subscriber identitymodule card). For example, the terminal is connected to a mouse by usinga universal serial bus (USB) port, and is connected, by using a metalcontact in a cart slot of a subscriber identity module card, to thesubscriber identity module (SIM) card provided by a telecommunicationsoperator. The peripheral interface 110 may be used to couple theforegoing external input/output device to the processor 101 and thememory 103.

In this embodiment of this application, the first terminal 100 mayconnect to the display of the second terminal 200 by using theperipheral interface 110 of the first terminal 100, so that the firstterminal 100 and the second terminal 200 can communicate with eachother.

The mobile phone 300 may further include the power supply apparatus 111(for example, a battery and a power management chip) that supplies powerto all the components. The battery may be logically connected to theprocessor 101 by using the power management chip, to implement functionssuch as charging management, discharging management, and powerconsumption management by using the power supply apparatus 111.

Although not shown in FIG. 5, the mobile phone 300 may further include acamera (a front-facing camera and/or a rear-facing camera), a cameraflash, a micro projection apparatus, a near field communication (NFC)apparatus, and the like. Details are not described herein.

A display method provided in an embodiment of this application isdescribed below in detail with reference to specific embodiments. Asshown in FIG. 6, the method includes the following steps.

501. A first terminal 100 connects to a second terminal 200, so that thefirst terminal 100 and the second terminal 200 can communicate with eachother.

The first terminal 100 may connect to the second terminal 200 by usingBluetooth, Wi-Fi, a ZigBee protocol (ZigBee), or another communicationmode. This is not limited in this embodiment of this application.

As shown in FIG. 7A and FIG. 7B, after the first terminal 100 connectsto the second terminal 200, different display IDs may be used todistinguish between a first application container corresponding to thefirst terminal 100 and a second application container corresponding tothe second terminal 200. For example, in FIG. 7A and FIG. 7B, anapplication task in the first application container corresponds to adisplay interface of the first terminal 100, and an application task inthe second application container corresponds to a display interface ofthe second terminal 200.

In this way, when a user operates an application A on the first terminal100, the first terminal 100 is triggered to store, in the firstapplication container, a related application task generated by theapplication A. The first terminal 100 executes the application task inthe first application container, and displays an execution result in thedisplay interface of the first terminal 100. In addition, when it isdetected that the user operates an application B on the second terminal200, the first terminal 100 may store, in the second applicationcontainer, a related application task generated by the application B.The first terminal 100 executes the application task in the secondapplication container, and displays output in the display interface ofthe second terminal 200.

In this case, the application B running in the display interface of thesecond terminal 200 is a target application. Therefore, when the firstterminal 100 disconnects from the second terminal 200, for example, adata cable between the first terminal 100 and the second terminal 200 isin poor contact, or the user walks out of a maximum connection distancebetween the first terminal 100 and the second terminal 200 when usingthe first terminal 100 to answer a call, the first terminal 100 maycontinue to perform the following steps 502 to 505.

502. When the first terminal 100 disconnects from the second terminal200, the first terminal 100 stops inputting first display data to thesecond terminal 200, so that a target application running in a displayinterface of the second terminal 200 is closed.

The first display data is display content that is displayed in thedisplay interface of the second terminal 200 before the first terminal100 disconnects from the second terminal 200. In this case, the displayinterface of the second terminal 200 may be referred to as a firstinterface, and the display interface of the first terminal 100 may bereferred to as a second interface. The first interface is different fromthe second interface. For example, in FIG. 7A and FIG. 7B, the firstinterface is a display interface of the application B, and the secondinterface is a display interface of the application A.

In addition, the target application may be a video application, a textapplication, an instant messaging application, a game application, orthe like. This is not limited in this embodiment of this application.

When the first terminal 100 disconnects from the second terminal 200,communication between the first terminal 100 and the second terminal 200is interrupted. In this case, the first display data (for example,display data generated when the application task in the secondapplication container is executed) generated for a display of the secondterminal 200 in the first terminal 100 cannot be output to a display ofthe second terminal 200. Consequently, a window of the targetapplication running in the display interface of the second terminal 200is forcibly closed.

As shown in FIG. 8, after the first terminal 100 disconnects from thesecond terminal 200, a window of the application B (the targetapplication) originally running in the display interface of the secondterminal 200 is forcibly closed, and the second terminal 200 switchesback to a native state. As shown in FIG. 8, the native state may be astandby state in which no signal is input. Certainly, the native statemay be any state configured in an operating system of the secondterminal 200, for example, a lock screen state or a black screen state.

503. The first terminal 100 records historical display data that is onthe second terminal 200 when the first terminal 100 disconnects from thesecond terminal 200, where the historical display data is used toindicate display content that is on the second terminal 200 at thistime.

504. When the first terminal 100 reconnects to the second terminal 200,the first terminal 100 obtains the historical display data.

505. The first terminal 100 sends second display data to the secondterminal 200 based on the historical display data, so that a window ofthe target application is resumed in the display interface of the secondterminal 200.

The second display data is display content that is displayed in thedisplay interface of the second terminal 200 after the first terminal100 reconnects to the second terminal 200. In this case, the displayinterface of the second terminal 200 may be referred to as a thirdinterface, and the third interface is correlated with the firstinterface displayed on the second terminal 200 before the disconnection.

For example, an application displayed in the third interface is the sameas an application displayed in the first interface; or an interfacedisplayed in the third interface is totally the same as an interfacedisplayed in the first interface; or an interface displayed in the thirdinterface and an interface displayed in the first interface are adjacentinterfaces of one application, and so on. This is described below indetail with reference to specific embodiments in this embodiment of thisapplication.

In order that the target application can seamlessly continue in thedisplay interface of the second terminal 200 when the first terminal 100reconnects to the second terminal 200, when the first terminal 100disconnects from the second terminal 200, the first terminal 100 storesthe historical display data used to indicate the display content that ison the second terminal 200 at this time.

It should be noted that there is no limited time sequence between step503 and step 502. When the first terminal 100 disconnects from thesecond terminal 200, the first terminal 100 may first perform step 502and then perform step 503, or first perform step 503 and then performstep 502, or simultaneously perform steps 502 and 503. This is notlimited in this embodiment of this application.

In a possible design method, the historical display data may bespecifically an application task, of the target application, in thesecond application container.

For example, as shown in FIG. 9, when the first terminal 100 disconnectsfrom the second terminal 200, the first terminal 100 may add anidentifier of the second terminal 200 to an application task, of thetarget application (namely, the application B), that is in the secondapplication container at this time, move the application task to thefirst application container corresponding to the display interface ofthe first terminal 100, and then delete the second applicationcontainer.

Therefore, when the first terminal 100 subsequently reconnects to thesecond terminal 200, as shown in FIG. 10, the first terminal 100 mayrecreate the second application container corresponding to the displayinterface of the second terminal 200, and resume, the second applicationcontainer, the application task that is of the application B and that isin the first application container.

In this way, as shown in FIG. 13, the first terminal 100 may continue toexecute the resumed application task in the second applicationcontainer, and display an execution result in the display interface ofthe second terminal 200, so that the window of the application B beforethe disconnection is resumed in the display interface of the secondterminal 200, and the application B seamlessly continues before andafter the disconnection is implemented.

In another possible design method, the historical display data may bespecifically running status information of the target application uponthe disconnection, for example, at least one of an application packagename, path information, encryption information, and the like of thetarget application upon the disconnection.

For example, as shown in FIG. 11, when the first terminal 100disconnects from the second terminal 200, the first terminal 100 mayextract the running status information such as the application packagename of the application B based on an application task, of the targetapplication (namely, the application B), that is in the secondapplication container at this time, store the running status informationin a read-only memory (ROM) of the first terminal 100, and then deletethe second application container.

Therefore, when the first terminal 100 subsequently reconnects to thesecond terminal 200, as shown in FIG. 12, the first terminal 100 mayrecreate the second application container for the display interface ofthe second terminal 200, and resume, in the second applicationcontainer, the application task of the application B based on therunning status information of the application B that is stored in theROM.

In this way, as shown in FIG. 13, the first terminal 100 may continue toexecute the resumed application task in the second applicationcontainer, and display an execution result in the display interface ofthe second terminal 200, so that the window of the application B beforethe disconnection is resumed in the display interface of the secondterminal 200, and the application B seamlessly continues before andafter the disconnection is implemented.

Further, the running status information may include a historicallocation of the window of the application B upon the disconnection. Inthis case, the first terminal 100 may resume the window of theapplication B at a corresponding location in the display interface ofthe second terminal 200 based on the historical location, so that thewindow of the application B is displayed at a same location on thesecond terminal 200 before and after the disconnection. This furtherimproves user experience in multi-screen display performed by aterminal.

In addition, because the running status information of the application Bis stored in the ROM of the first terminal 100, the running statusinformation is not lost even after the first terminal 100 is powered offand powered on again. In other words, in the foregoing embodiment, evenif the first terminal 100 is powered off and powered on again after thefirst terminal 100 disconnects from the second terminal 200, after thefirst terminal 100 reconnects to the second terminal 200, the firstterminal 100 can also resume the window of the application B in thedisplay interface of the second terminal 200. In this way, theapplication B seamlessly continues before and after the disconnection isimplemented.

In some embodiments of this application, as shown in FIG. 14, when thefirst terminal 100 and the second terminal 200 are in a connected mode,the window of the application B is displayed in the display interface ofthe second terminal 200. If the first terminal 100 records only theapplication package name of the application B in the display interfaceof the second terminal 200 when the first terminal 100 disconnects fromthe second terminal 200, when the first terminal 100 reconnects to thesecond terminal 200, still as shown in FIG. 14, the first terminal 100may restart the application B in the display interface of the secondterminal 200 based on the recorded application package name of theapplication B. In this case, a display interface in the window of theapplication B in the display interface of the second terminal 200 may bedifferent from a display interface in the window of the application Bbefore the disconnection.

In some other embodiments of this application, as shown in FIG. 15, whenthe first terminal 100 and the second terminal 200 are in a connectedmode, a window of a read type application is displayed in the displayinterface of the second terminal 200. For example, text content on Page18 is being displayed in the window. When the first terminal 100disconnects from the second terminal 200, the first terminal 100 mayrecord an application package name of the read type application and acurrently displayed page number: Page 18. Therefore, when the firstterminal 100 reconnects to the second terminal 200, still as shown inFIG. 15, the first terminal 100 may restart the read type application inthe display interface of the second terminal 200 based on the recordedapplication package name of the read type application. In addition, thefirst terminal 100 may further display, in the display interface of thesecond terminal 200, the text content on Page 18 again based on therecorded currently displayed page number. In other words, documentcontent displayed in the third interface is the same as document contentdisplayed in the first interface. In this way, the read type applicationseamlessly continues on the second terminal 200 before and after thedisconnection is implemented.

In some other embodiments of this application, as shown in FIG. 16, whenthe first terminal 100 and the second terminal 200 are in a connectedmode, a window of an instant messaging application is displayed in thedisplay interface of the second terminal 200, a user is inputting chatinformation to an input box of the instant messaging application, andthe chat information has not been sent. When the first terminal 100disconnects from the second terminal 200, the first terminal 100 mayrecord an application package name of the instant messaging application,a current chat record, and the chat information input to the input box.Therefore, when the first terminal 100 reconnects to the second terminal200, still as shown in FIG. 16, the first terminal 100 may restart theinstant messaging application in the display interface of the secondterminal 200 based on the recorded application package name of theinstant messaging application. In addition, the first terminal 100 mayfurther display again, in the display interface of the second terminal200 based on the recorded chat record and the chat draft (for example,“may be 3:00 p.m.” that has not been sent by the user in FIG. 16) inputto the input box, the chat record of the user and the chat draft inputto the input box. In this way, the instant messaging applicationseamlessly continues on the second terminal 200 before and after thedisconnection is implemented.

In some other embodiments of this application, as shown in FIG. 17A andFIG. 17B, when the first terminal 100 and the second terminal 200 are ina connected mode, a window of a game application is displayed in thedisplay interface of the second terminal 200. For example, a gameinterface of Level 1 of Gold Miner is being displayed. When the firstterminal 100 disconnects from the second terminal 200, the firstterminal 100 may record an application package name of the gameapplication and a currently paused level: Level 1. Therefore, when thefirst terminal 100 reconnects to the second terminal 200, still as shownin FIG. 17A and FIG. 17B, the first terminal 100 may restart the gameapplication in the display interface of the second terminal 200 based onthe recorded application package name of the game application. Inaddition, the first terminal 100 may further display again, in thedisplay interface of the second terminal 200 based on the level at whichthe game application pauses on the second terminal 200 upon thedisconnection, a system interface for entering Level 1 of Gold Miner. Inthis case, the game startup interface (namely, the third interface) isan interface adjacent to the game interface (namely, the firstinterface) of Level 1 of Gold Miner before the disconnection.

Therefore, after a user taps a “Level 1” button in the system interfaceof Level 1 of Gold Miner that is displayed on the second terminal 200,the second terminal 200 may be triggered to display a game interfacethat appears after Level 1 is entered, to resume the window of the gameapplication on the second terminal 200 before the disconnection. In thisway, the game application continues on the second terminal 200 beforeand after the disconnection. Certainly, the user may trigger, on thefirst terminal 100, the first terminal 100 to send a switch instructionto the second terminal 200. In this case, the first terminal 100 sends,to the second terminal 200, display data in the game interface (namely,the first interface) of Level 1 of Gold Miner, so that the secondterminal 200 displays the game interface that appears after Level 1 isentered. This is not limited in this embodiment of this application.

In some other embodiments of this application, the target applicationmay be specifically a player application. As shown in FIG. 18A, afterthe first terminal 100 connects to the second terminal 200, a user mayopen an application A on the first terminal 100 to view documentcontent, and open the player application on the second terminal 200 towatch TV series at the same time. For example, the user is watchingEpisode 5 of House of Cards. In this case, as shown in FIG. 18B, if thefirst terminal 100 disconnects from the second terminal 200, the firstterminal 100 closes Episode 5 of House of Cards that is being played onthe display of the second terminal 200, and the display of the secondterminal 200 presents a no signal input state. In addition, when thefirst terminal 100 disconnects from the second terminal 200, the firstterminal 100 may also record historical display data that is on thesecond terminal 200 at this time, for example, move, to the firstapplication container corresponding to the first terminal 100, anapplication task (for example, displaying an interface at the fifteenthminute of Episode 5 of House of Cards) that is generated by the playerapplication and that is in the second application containercorresponding to the second terminal 200. Therefore, if the firstterminal 100 subsequently reconnects to the second terminal 200, thefirst terminal 100 may recreate the second application container for thedisplay of the second terminal 200, and move the application task backto the second application container. In this way, as shown in FIG. 18C,the first terminal 100 may continue to execute the resumed applicationtask in the second application container, and display an executionresult in the display interface of the second terminal 200, so that theinterface at the fifteenth minute of Episode 5 of House of Cards isresumed in the display interface of the second terminal 200. In thisway, video playback progress in the third interface is the same as videoplayback progress in the first interface, and the player applicationseamlessly continues before and after the disconnection is implemented.

In addition, before the first terminal 100 disconnects from the secondterminal 200, a plurality of applications, such as a plurality ofapplication windows, may be displayed in the first interface of thesecond terminal 200. Therefore, after the first terminal 100 reconnectsto the second terminal 200, at least one of applications resumed in thethird interface of the second terminal 200 is the same as an applicationin the first interface, or an application resumed in the third interfaceof the second terminal 200 may be a subset of applications displayed inthe first interface; or an application resumed in the third interface ofthe second terminal 200 may be totally the same as an applicationdisplayed in the first interface. This is not limited in this embodimentof this application.

Further, as shown in FIG. 19, when the first terminal 100 disconnectsfrom the second terminal 200, the first terminal 100 may further switch,for running, the application B running on the second terminal 200 to thedisplay interface of the first terminal 100.

In this case, the current display interface of the first terminal 100may be referred to as a fourth interface, and the fourth interface isalso correlated with the third interface that is displayed on the secondterminal 200 before the disconnection.

For example, an interface element, such as an application icon or acontrol, in the fourth interface displayed on the first terminal 100 isthe same as an interface element in the third interface displayed on thesecond terminal 200, but display specification information, such as asize and a resolution, of each interface element in the fourth interfacemay be different from display specification information of eachinterface element in the third interface.

For example, Page 18 of a ** document is displayed in the thirdinterface of the second terminal 200 before disconnection. In this case,when the first terminal 100 disconnects from the second terminal 200,the first terminal 100 may adjust a resolution of display content onPage 18 of the document to a resolution that fits the display of thefirst terminal 100, to continue to display Page 18 of the document onthe display of the first terminal 100. For another example, a displayinterface at the fifteenth minute of a video A is displayed in the thirdinterface of the second terminal 200 before disconnection. In this case,when the first terminal 100 disconnects from the second terminal 200,the first terminal 100 may adjust a resolution of the display interfaceat the fifteenth minute of the video A, so that the terminal cancontinue to display the display interface at the fifteenth minute of thevideo A on the display of the first terminal 100.

For example, as shown in FIG. 20, when the first terminal 100disconnects from the second terminal 200, before deleting the secondapplication container, the first terminal 100 may move an applicationtask, of the application B, in the second application container to astack top of the first application container. In this way, whenexecuting a task in the first application container, the first terminal100 first executes the application task, of the application B, that isat the stack top. In other words, the first terminal 100 continues torun the application B in the display interface of the first terminal100, so that a user may still continue to perform, on the first terminal100, a related function of the application B during the disconnection,thereby reducing impact, on an execution process of the application B,that is caused because the first terminal 100 disconnects from thesecond terminal 200.

For example, after the first terminal 100 connects to the secondterminal 200, a window of a read type application is running in thedisplay interface of the second terminal 200, and an application taskcurrently generated in the second application container is displayingPage 18 of a ** document. Therefore, when the first terminal 100disconnects from the second terminal 200, the first terminal 100 addsthe application task “displaying Page 18 of the ** document” that is inthe second application container to the stack top of the firstapplication container. In this way, after the first terminal 100executes the application task “displaying Page 18 of the ** document”that is at the stack top of the first application container, Page 18 ofthe ** document is displayed in the display interface of the firstterminal 100, so that after the disconnection, the application runningon the second terminal 200 is switched to the display interface of thefirst terminal 100 to continue running.

For another example, after the first terminal 100 connects to the secondterminal 200, a window of a game application is running in the displayinterface of the second terminal 200, and an application task currentlygenerated in the second application container is displaying a gameinterface of Level 6. Therefore, when the first terminal 100 disconnectsfrom the second terminal 200, the first terminal 100 adds theapplication task “displaying the game interface of Level 6” that is inthe second application container to the stack top of the firstapplication container. In this way, after the first terminal 100executes the application task “displaying the game interface of Level 6”that is at the stack top of the first application container, the gameinterface of Level 6 in the game application is displayed in the displayinterface of the first terminal 100, so that after the disconnection,the application running on the second terminal 200 is switched to thedisplay interface of the first terminal 100 to continue running.

For another example, after the first terminal 100 connects to the secondterminal 200, a window of a video application is running in the displayinterface of the second terminal 200, and an application task currentlygenerated in the second application container is playing an interface atthe twentieth minute of Episode 5 of House of Cards. In this case, whenthe first terminal 100 disconnects from the second terminal 200, thefirst terminal 100 adds the application task “playing the interface atthe twentieth minute of Episode 5 of House of Cards” that is in thesecond application container to the stack top of the first applicationcontainer. In this way, after the first terminal 100 executes theapplication task “playing the interface at the twentieth minute ofEpisode 5 of House of Cards” that is at the stack top of the firstapplication container, the interface at the twentieth minute of Episode5 of House of Cards is played in the display interface of the firstterminal 100, so that after the disconnection, the application runningon the second terminal 200 is switched to the display interface of thefirst terminal 100 to continue running.

In addition, when moving the application task, of the application B, inthe second application container to the stack top of the firstapplication container, the first terminal 100 may adjust the applicationtask, of the application B, in the second application container based onspecification information such as a resolution and DPI of the display ofthe second terminal 200, so that the application task meets thespecification information of the display of the second terminal 200.

For another example, a resolution of the first terminal 100 is A, and aresolution of the second terminal 200 is B. A common player applicationusually supports displays with a plurality of resolutions (for example,when the application B is launched in an application market, theapplication B supports a display with the resolution A and a displaywith the resolution B). Therefore, when the first terminal 100disconnects from the second terminal 200, the first terminal 100 maychange a resolution parameter of the application B to B, and then movethe application task, of the application B, in the second applicationcontainer to the stack top of the first application container, so that auser can watch, on the display of the second terminal 200, displaycontent that matches the resolution of the display of the secondterminal 200, thereby improving a user experience.

It may be understood that to implement the foregoing functions, theforegoing terminal and the like include a corresponding hardwarestructure and/or software module for performing each of the functions. Aperson skilled in the art should be easily aware that the units andalgorithm steps in the examples described with reference to theembodiments disclosed in this specification may be implemented byhardware or a combination of hardware and computer software in theembodiments of this application. Whether a function is performed byhardware or computer software driving hardware depends on a particularapplication and a design constraint condition of the technicalsolutions. A person skilled in the art may use different methods toimplement the described functions for each particular application, butit should not be considered that the implementation goes beyond thescope of the embodiments of this application.

In the embodiments of this application, the terminal may be divided intofunction modules based on the foregoing method example. For example,each function module may be obtained through division based on eachcorresponding function, or two or more functions may be integrated intoone processing module. The integrated module may be implemented in aform of hardware, or may be implemented in a form of a software functionmodule. It should be noted that the module division in the embodimentsof this application is an example, and is merely logical functiondivision. There may be another division manner in an actualimplementation.

When each function module is obtained through division based on acorresponding function, FIG. 21 is a possible schematic structuraldiagram of a terminal (for example, the first terminal or the secondterminal) in the foregoing embodiment. The terminal includes acommunications unit 1101, a control unit 1102, and a record unit 1103.

The communications unit 1101 is configured to support the terminal inperforming processes 501 and 505 in FIG. 6. The control unit 1102 isconfigured to support the terminal in performing processes 502 and 504in FIG. 6. The record unit 1103 is configured to support the terminal inperforming the process 503 in FIG. 6. All related content of each stepin the foregoing method embodiments may be cited in functiondescriptions of a corresponding function module. Details are notdescribed herein again.

When an integrated unit is used, FIG. 22 is a possible schematicstructural diagram of a terminal (for example, the first terminal or thesecond terminal) in the foregoing embodiment. The terminal includes aprocessing module 1302 and a communications module 1303. The processingmodule 1302 is configured to control and manage an action of theterminal. The communications module 1303 is configured to supportcommunication between the terminal and another network entity. Theterminal may further include a storage module 1301 that is configured tostore program code and data of the terminal.

The processing module 1302 may be a processor or a controller, forexample, may be a central processing unit (Central Processing Unit,CPU), a general purpose processor, a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit(Application-Specific Integrated Circuit, ASIC), a field programmablegate array (Field Programmable Gate Array, FPGA) or another programmablelogic device, a transistor logic device, a hardware component, or anycombination thereof. The processing module 1302 may implement or executevarious examples of logical blocks, modules, and circuits that aredescribed with reference to the content disclosed in this application.The processor may also be a combination implementing a computingfunction, for example, a combination including one or moremicroprocessors or a combination of a DSP and a microprocessor. Thecommunications module 1303 may be a transceiver, a transceiver circuit,a communications interface, or the like. The storage module 1301 may bea memory.

When the processing module 1302 is a processor, the communicationsmodule 1303 is an RF transceiver circuit, and the storage module 1301 isa memory, the terminal provided in this embodiment of this applicationmay be the mobile phone 300 shown in FIG. 5.

All or some of the foregoing embodiments may be implemented by usingsoftware, hardware, firmware, or any combination thereof. When asoftware program is used to implement the embodiments, the embodimentsmay be implemented completely or partially in a form of a computerprogram product. The computer program product includes one or morecomputer instructions. When the computer program instructions are loadedand executed on the computer, the procedures or functions according tothe embodiments of this application are all or partially generated. Thecomputer may be a general-purpose computer, a dedicated computer, acomputer network, or another programmable apparatus. The computerinstructions may be stored in a computer-readable storage medium or maybe transmitted from a computer-readable storage medium to anothercomputer-readable storage medium. For example, the computer instructionsmay be transmitted from a website, computer, server, or data center toanother website, computer, server, or data center in a wired (forexample, a coaxial cable, an optical fiber, or a digital subscriber line(DSL)) or wireless (for example, infrared, radio, microwave, or thelike) manner. The computer-readable storage medium may be any usablemedium accessible by a computer, or a data storage device, such as aserver or a data center, that integrates one or more usable media. Theusable medium may be a magnetic medium (for example, a floppy disk, ahard disk, or a magnetic tape), an optical medium (for example, a DVD),a semiconductor medium (for example, a solid state disk Solid StateDisk, (SSD)), or the like.

The foregoing descriptions are merely specific implementations of thisapplication, but are not intended to limit the protection scope of thisapplication. Any variation or replacement within the technical scopedisclosed in this application shall fall within the protection scope ofthis application. Therefore, the protection scope of this applicationshall be subject to the protection scope of the claims.

The invention claimed is:
 1. A display method, comprising: sending, by afirst terminal, first display data to a second terminal after the firstterminal connects to the second terminal, wherein the first display datacorresponds to a first interface of a second application displayed bythe second terminal, wherein the first terminal displays a secondinterface of a first application, wherein the first interface isdifferent from the second interface, wherein the first terminal stores afirst application task of the first application in a first applicationcontainer when the first terminal and the second terminal are connected,and the first terminal stores a second application task of the secondapplication in a second application container when the first terminaland the second terminal are connected; disconnecting, by the firstterminal, from the second terminal; storing, by the first terminal, thesecond application task in the first application container; displaying,by the first terminal, a fourth interface of the second application;reconnecting, by the first terminal, to the second terminal; resuming,by the first terminal, in the second application container, the secondapplication task of the second application; and sending, by the firstterminal, second display data to the second terminal, wherein the seconddisplay data corresponds to a third interface of the second applicationdisplayed by the second terminal, wherein the third interface iscorrelated with the first interface.
 2. The method of claim 1, whereinthat the third interface is correlated with the first interfacecomprises: the third interface is the same as the first interface. 3.The method of claim 2, wherein that the third interface is the same asthe first interface comprises: video playback progress displayed in thethird interface is the same as video playback progress displayed in thefirst interface.
 4. The method of claim 2, wherein that the thirdinterface is the same as the first interface comprises: document contentdisplayed in the third interface is the same as document contentdisplayed in the first interface.
 5. The method of claim 1, wherein adisplay location of the third interface is the same as a displaylocation of the first interface.
 6. The method of claim 1, wherein aninterface element in the fourth interface is the same as an interfaceelement in the third interface.
 7. The method of claim 1, whereinsending second display data to the second terminal comprises: sendingsecond display data to the second terminal according to historicaldisplay data recorded by the first terminal, wherein the historicaldisplay data comprises running status information of the secondapplication, and wherein the historical display data comprises ahistorical location of the first interface of the second application. 8.A first terminal comprising: a processor; and a memory coupled to theprocessor, wherein the memory comprises instructions that, when executedby the processor, cause the first terminal to perform operationscomprising: sending first display data to a second terminal after thefirst terminal connects to the second terminal, wherein the firstdisplay data corresponds to a first interface of a second applicationdisplayed by the second terminal, wherein the first terminal displays asecond interface of a first application, wherein the first interface isdifferent from the second interface, wherein the first terminal stores afirst application task of the first application in a first applicationcontainer when the first terminal and the second terminal are connected,and the first terminal stores a second application task of the secondapplication in a second application container when the first terminaland the second terminal are connected; disconnecting from the secondterminal; storing the second application task in the first applicationcontainer; displaying a fourth interface of the second application;reconnecting to the second terminal; resuming in the second applicationcontainer, the second application task of the second application; andsending second display data to the second terminal, wherein the seconddisplay data corresponds to a third interface of the second applicationdisplayed by the second terminal, wherein the third interface iscorrelated with the first interface.
 9. The first terminal of claim 8,wherein that the third interface is correlated with the first interfacecomprises: the third interface is the same as the first interface. 10.The first terminal of claim 9, wherein that the third interface is thesame as the first interface comprises: video playback progress displayedin the third interface is the same as video playback progress displayedin the first interface.
 11. The first terminal of claim 9, wherein thatthe third interface is the same as the first interface comprises:document content displayed in the third interface is the same asdocument content displayed in the first interface.
 12. The firstterminal of claim 8, wherein a display location of the third interfaceis the same as a display location of the first interface.
 13. The firstterminal of claim 8, wherein an interface element in the fourthinterface is the same as an interface element in the third interface.14. The first terminal of claim 8, wherein sending second display datato the second terminal comprises: sending second display data to thesecond terminal according to historical display data recorded by thefirst terminal, wherein the historical display data comprises runningstatus information of the second application, and wherein the historicaldisplay data comprises a historical location of the first interface ofthe second application.
 15. The terminal according to claim 8, whereinthe storing the second application task in the first applicationcontainer comprises: automatically storing the second application taskin the first application container in response to disconnecting from thesecond terminal.
 16. The terminal according to claim 8, wherein theresuming in the second application container, the second applicationtask of the second application comprises: automatically resuming in thesecond application container, the second application task of the secondapplication in response to reconnecting to the second terminal.
 17. Acomputer program product comprising computer-executable instructionsstored on a non-transitory computer-readable storage medium that, whenexecuted by a processor of a first terminal, cause the first terminal toperform operations comprising: sending first display data to a secondterminal after the first terminal connects to the second terminal,wherein the first display data corresponds to a first interface of asecond application displayed by the second terminal, wherein the firstterminal displays a second interface of a first application, wherein thefirst interface is different from the second interface, wherein thefirst terminal stores a first application task of the first applicationin a first application container when the first terminal and the secondterminal are connected, and the first terminal stores a secondapplication task of the second application in a second applicationcontainer when the first terminal and the second terminal are connected;disconnecting from the second terminal; storing the second applicationtask in the first application container; displaying a fourth interfaceof the second application; reconnecting to the second terminal; resumingin the second application container, the second application task of thesecond application; and sending second display data to the secondterminal, wherein the second display data corresponds to a thirdinterface of the second application displayed by the second terminal,wherein the third interface is correlated with the first interface. 18.The computer program product of claim 17, wherein that the thirdinterface is correlated with the first interface comprises: the thirdinterface is the same as the first interface.
 19. The computer programproduct of claim 18, wherein that the third interface is the same as thefirst interface comprises: video playback progress displayed in thethird interface is the same as video playback progress displayed in thefirst interface.
 20. The computer program product of claim 17, wherein adisplay location of the third interface is the same as a displaylocation of the first interface.